
Ext.define('web.common.server.Ajax', {
	config : {
		url : '',
		method : 'POST',
		timeout : 30000,
		params : [],
		successHandlerFnc : '',
		failureHandlerFnc : ''
	},
	constructor : function(cfg){		
		this.initConfig(cfg);
	},
	getHandlerFnc : function(handlerFnc){		
		handlerFnc = handlerFnc+'(response, options)';
		eval(handlerFnc);
	},
	request : function(){
		var me = this;
		Ext.Ajax.request({
			url : me.getUrl(),
			method : me.getMethod(),
			timeout : me.getTimeout(),
			params : me.getParams(),
			success : me.getHandlerFnc(me.getSuccessHandlerFnc()),
			failure : me.getHandlerFnc(me.getFailureHandlerFnc())
		});
	}
});
	